<template>
  <div class="C_XTPZ_XTPZ">
    <div class="main">
      <el-tabs tab-position="left" style="height: 900px;" type="border-card">
        <el-tab-pane label="短信接口方式">
          <el-radio-group v-model="radio">
            <el-radio :label="3">移动mas云</el-radio>
            <el-radio :label="6">医惠集成平台</el-radio>
            <el-radio :label="9">网易云</el-radio>
            <el-radio :label="10">儿童医院短信接口</el-radio>
          </el-radio-group>
          <el-button style="float:right">保存</el-button>
          <div>
            审核短信模板：
            <el-input></el-input>
            侯办短信模板：
            <el-input></el-input>
            追踪短信模板：
            <el-input></el-input>
            意见反馈模板：
            <el-input></el-input>
            危机值短信模板：
            <el-input></el-input>
          </div>
        </el-tab-pane>
        <el-tab-pane label="获取病人信息">
          <el-radio-group v-model="radio">
            <el-radio :label="3">医惠集成平台</el-radio>
            <el-radio :label="6">HIS视图</el-radio>
          </el-radio-group>
          <el-button style="float:right">保存</el-button>
          <div>
            数据库类型：
            <el-input></el-input>
            数据库IP：
            <el-input></el-input>
            实例名：
            <el-input></el-input>
            端口号：
            <el-input></el-input>
            数据库名：
            <el-input></el-input>
            用户名：
            <el-input></el-input>
            密码：
            <el-input></el-input>
            住院视图名：
            <el-input></el-input>
            门诊视图名：
            <el-input></el-input>
            获取电话sql：
            <el-input></el-input>
            更新电话sql：
            <el-input></el-input>
          </div>
        </el-tab-pane>
        <el-tab-pane label="初始基本设置">
          <el-form
            label-position="right"
            label-width="400px"
            :model="formLabelAlign"
            style="height: 900px;overflow:auto"
          >
            <el-form-item label="医院名称：">
              <el-input v-model="formLabelAlign.name"></el-input>
            </el-form-item>
            <el-form-item label="国家网药品不良反应账号密码：">
              <el-input v-model="formLabelAlign.region"></el-input>
            </el-form-item>
            <el-form-item label="国家网器械不良反应账号密码：">
              <el-input v-model="formLabelAlign.type"></el-input>
            </el-form-item>
            <el-form-item label="国家网药品不良反应映射IP：">
              <el-input v-model="formLabelAlign.type"></el-input>
            </el-form-item>
            <el-form-item label="国家网器械不良反应映射IP：">
              <el-input v-model="formLabelAlign.type"></el-input>
            </el-form-item>
            <el-form-item label="是否启用鱼骨图：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="是否启用结案评价：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="是否启用结案原因分析：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="是否区分驳回和提交：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="是否发起追踪任务：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="首次提交是否弹出提交页面：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="是否显示被驳回：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="是否显示上报模板：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="上报者是否分析鱼骨图：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="提交时是否显示匿名：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="是否显示科室讨论记录：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="儿童医院总开关：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="事件等级显示详细内容：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="个人信息签名：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="打印显示讨论记录：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="职能部门结案事件评价：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="职能部门结案整改措施：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="首次登录修改密码及密码复杂验证：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="撤销结案删除填写内容：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="是否展示制度的审批：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="是否展示上报人：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="护士长和科主任同时审核：">
              <el-select v-model="value" placeholder="请选择">
                <el-option label="启用" value="启用"> </el-option>
                <el-option label="关闭" value="关闭"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="">
              <el-button>保存</el-button>
            </el-form-item>
          </el-form>
        </el-tab-pane>
        <el-tab-pane label="APP接入方式">
          <el-radio-group v-model="radio">
            <el-radio :label="3">企业微信</el-radio>
            <el-radio :label="6">钉钉</el-radio>
          </el-radio-group>
          <el-button style="float:right">保存</el-button>
          <div>
            公司ID（Corpid）：
            <el-input></el-input>
            应用标识（AppKey）：
            <el-input></el-input>
            应用密钥（AppSecret）：
            <el-input></el-input>
            应用ID（Agentid）：
            <el-input></el-input>
            应用首页URL：
            <el-input></el-input>
            发送信息URL：
            <el-input></el-input>
            钉钉应用IP：
            <el-input></el-input>
            PC应用IP：
            <el-input></el-input>
          </div>
        </el-tab-pane>
        <el-tab-pane label="监测基本设置">
          <div>
            数据库类型：
            <el-input></el-input>
            数据库IP：
            <el-input></el-input>
            实例名：
            <el-input></el-input>
            端口号：
            <el-input></el-input>
            数据库名：
            <el-input></el-input>
            用户名：
            <el-input></el-input>
            密码：
            <el-input></el-input>
            <el-button>保存</el-button>
          </div>
        </el-tab-pane>
        <el-tab-pane label="开关基本设置">
          <div class="C_CSSZ_MBWH">
            <div class="title">
              开关基本设置
            </div>
            <div class="query">
              开关编码：
              <el-input size="small" class="input_style"></el-input>
              选择模板名称：
              <el-select
                style="width:200px;display:inline-block"
                size="small"
                v-model="formLabelAlign.region"
                filterable
                placeholder="请选择"
              >
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
              <el-button
                size="small"
                icon="el-icon-search"
                type="primary"
                style="margin-left:5px"
                >搜索</el-button
              >
              <el-button
                size="small"
                icon="el-icon-plus"
                type="primary"
                style="margin-left:5px"
                @click="open('add')"
                >新建</el-button
              >
            </div>
            <div class="main">
              <el-table
                :data="tableData"
                border
                height="700"
                style="width: 100%"
                :header-cell-style="{
                  background: 'rgb(246,250,253)',
                  color: '#000000',
                }"
              >
                <el-table-column prop="date" label="模板名称" width="160">
                </el-table-column>
                <el-table-column prop="address" label="关联事件" width="180">
                </el-table-column>
                <el-table-column prop="address" label="模板内容">
                </el-table-column>
                <el-table-column label="操作" width="180" align="center">
                  <template slot-scope="scope">
                    <el-button
                      type="text"
                      icon="el-icon-edit"
                      title="编辑"
                      @click="open('edit', scope.row)"
                    ></el-button>
                    <el-button
                      type="text"
                      icon="el-icon-delete"
                      title="删除"
                    ></el-button>
                  </template>
                </el-table-column>
              </el-table>
              <div class="block" style="text-align:center;margin-top:5px">
                <el-pagination layout="prev, pager, next" :total="50">
                </el-pagination>
              </div>
            </div>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
    <!-- 弹层 -->
    <el-dialog
      :title="titleText"
      :visible.sync="dialogVisible"
      width="55%"
      :before-close="handleClose"
      :append-to-body="true"
      :close-on-click-modal="false"
    >
      <el-form
        label-position="right"
        label-width="150px"
        :model="formLabelAlign"
      >
        <el-form-item label="编码：">
          <el-input v-model="formLabelAlign.region"></el-input>
        </el-form-item>
        <el-form-item label="名称：">
          <el-input v-model="formLabelAlign.region"></el-input>
        </el-form-item>
        <el-form-item label="内容：">
          <el-input v-model="formLabelAlign.region"></el-input>
        </el-form-item>
        <el-form-item label="是否启用：">
          <el-select
            style="width:100%"
            v-model="formLabelAlign.region"
            filterable
            placeholder="请选择"
          >
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  // 组件名称
  name: "",
  // 局部注册的组件
  components: {},
  // 组件参数 接收来自父组件的数据
  props: {},
  // 组件状态值
  data() {
    return {
      radio: 3,
      formLabelAlign: {},
      tableData: [
        {
          date: "2016-05-02",
          name: "已启用",
          address: "金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "已启用",
          address: "金沙江路 1517 弄",
        },
        {
          date: "2016-05-01",
          name: "已启用",
          address: "金沙江路 1519 弄",
        },
        {
          date: "2016-05-03",
          name: "已启用",
          address: "金沙江路 1516 弄",
        },
      ],
      options: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶",
        },
        {
          value: "选项3",
          label: "蚵仔煎",
        },
        {
          value: "选项4",
          label: "龙须面",
        },
        {
          value: "选项5",
          label: "北京烤鸭",
        },
      ],
      titleText: "",
      value: "",
      dialogVisible: false,
    };
  },
  // 计算属性
  computed: {},
  // 侦听器
  watch: {},
  // 生命周期钩子   注：没用到的钩子请自行删除
  /**
   * 组件实例创建完成，属性已绑定，但DOM还未生成，$ el属性还不存在
   */
  created() {},
  /**
   * el 被新创建的 vm.el 替换，并挂载到实例上去之后调用该钩子。
   * 如果 root 实例挂载了一个文档内元素，当 mounted 被调用时 vm.el 也在文档内。
   */
  mounted() {},
  // 组件方法
  methods: {
    open(flag, val) {
      if (flag == "add") {
        this.titleText = "新增开关";
      }
      if (flag == "edit") {
        this.titleText = "编辑开关";
      }
      if (val) {
      }
      this.dialogVisible = true;
    },
    handleClose() {
      this.dialogVisible = false;
    },
    handleSelectionChange(val) {
      this.codes = val;
    },
    addPlus() {
      this.tableData_a.push({ date: "", address: "" });
    },
    del_row() {
      var that = this;
      this.codes.forEach((item) => {
        that.tableData_a.forEach((item2, index) => {
          if (item.address == item2.address) {
            this.tableData_a.splice(index, 1);
          }
        });
      });
    },
  },
};
</script>

<style scoped lang="scss">
.C_CSSZ_MBWH {
  .title {
    background-color: rgb(233, 242, 255);
    line-height: 45px;
    font-size: 18px;
    font-weight: 700;
    padding: 0 10px;
  }
  .query {
    margin: 0 10px;
    margin-top: 10px;
    padding: 5px;
    border: 1px solid #ccc;
    line-height: 40px;
  }
  .main {
    padding: 0 10px;
    margin-top: 10px;
  }
}
.input_style {
  display: inline-block;
  width: 200px;
}
</style>
